package com.pricl.frame.common.web.rest;

import org.springframework.http.HttpStatus;

/**
 * <ol>
 * <li>REST 响应状态码</li>
 * <ol>
 * 
 * @author jackzhong
 * @since 2014年10月25日下午11:02:54
 */
public class RestResponseCode {

	// 请求成功
	public final static HttpStatus STATUS_OK = HttpStatus.OK;
	// 请求失败
	public final static HttpStatus STATUS_BAD = HttpStatus.BAD_REQUEST;
	//　未授权
	public final static HttpStatus UNAUTHORIZED = HttpStatus.UNAUTHORIZED;
	
	//获取请求成功码
	public static String getSuccessResponseCode(){
		return String.valueOf(STATUS_OK.value());
	}
	
	//获取请求失败码
	public static String getFailureResponseCode(){
		return String.valueOf(STATUS_BAD.value());
	}
	
	//未授权
	public static String getUnauthorizedCode(){
		return String.valueOf(UNAUTHORIZED.value());
	}
	
}
